# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gnome-boxes
pkgver=46.0
pkgrel=0
pkgdesc="Virtualization made simple"
url="https://wiki.gnome.org/Apps/Boxes"
arch="all"
license="GPL-2.0-only"
makedepends="
	desktop-file-utils
	freerdp-dev
	glib-dev
	gtk+3.0-dev
	gtk-vnc-dev
	gtksourceview4-dev
	itstool
	libarchive-dev
	libgudev-dev
	libhandy1-dev
	libosinfo-dev
	libportal-dev
	libsecret-dev
	libsoup3-dev
	libusb-dev
	libvirt-glib-dev
	libxml2-dev
	meson
	spice-gtk-dev
	tracker-dev
	vala
	vte3-dev
	webkit2gtk-4.1-dev
	"
depends="
	libvirt-qemu
	qemu
	qemu-audio-spice
	qemu-chardev-spice
	qemu-img
	qemu-hw-display-qxl
	qemu-hw-display-virtio-gpu
	qemu-hw-display-virtio-vga
	qemu-hw-usb-redirect
	"
case $CARCH in
	x86_64) depends="$depends qemu-system-x86_64";;
	x86) depends="$depends qemu-system-i386";;
	aarch64) depends="$depends qemu-system-aarch64";;
esac
subpackages="$pkgname-lang $pkgname-doc"
source="https://download.gnome.org/sources/gnome-boxes/${pkgver%%.*}/gnome-boxes-$pkgver.tar.xz
	add-smartcard-disable-option.patch
	"

build() {
	abuild-meson \
		-Db_lto=true \
		-Dsmartcard=false \
		. output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
f5c3289d90729d8c8a8044e9392eb10f6fafc1718007ec9192b7445fa93fb2c05cecd3fcf0c3ce20554e676d9bec47c335df01e2b45b613c39eb5dd4a4f2cea8  gnome-boxes-46.0.tar.xz
f66ee3b817856ad7a45723c656836f7097419ac0942544aaa04d646bd45480c07615e5a2e2a2987347dd6907fcd25ee9b0ac84bfdc6bbe8cdff919a99484827b  add-smartcard-disable-option.patch
"
